﻿using System;
using System.Timers;
namespace Controller
{
	class PlayerComputer : AbstractPlayer
	{
		protected ReversiController reversi;

		public PlayerComputer(int id, Token token, ReversiController reversi, bool timerEnabled, double timerInterval)
			: base(id, token, timerEnabled, timerInterval)
		{
			this.reversi = reversi;
		}

		protected override void MakeMove(object sender, ElapsedEventArgs e)
		{
			Random random = new Random();
			int index = random.Next(possibleMoves.Length - 1);
			reversi.PlaceToken(possibleMoves[index].Column, possibleMoves[index].Row, this.GetType());
		}
	}
}
